<template>
  <el-dropdown v-if="devMode" @command="executeCommand">
    <template v-if="prop">
      <span>
        <span>{{prop.name}}</span>
      </span>
      <el-dropdown-menu slot="dropdown">
        <el-dropdown-item command="configProperty">配置属性</el-dropdown-item>
        <el-dropdown-item command="cloneProperty" divided>克隆属性</el-dropdown-item>
        <el-dropdown-item command="deleteProperty" style="color: #F56C6C">删除属性</el-dropdown-item>
      </el-dropdown-menu>
      <el-dialog :visible.sync="openConfig"  width="1200px" append-to-body v-if="openConfig">
        <template slot="title">
          配置属性<el-tag>{{prop.name}}</el-tag>
        </template>
        <rva-tcrud appId="tcrud1_rva_viewproperty" :requestParams="{rvaAppParams: prop}"></rva-tcrud>
      </el-dialog>
      <el-dialog :visible.sync="openClone" width="900px" append-to-body v-if="openClone">
        <template slot="title">
          克隆属性<el-tag>{{prop.name}}</el-tag>
        </template>
        <rva-form viewId="c7_rva_viewproperty" :requestParams="{rvaAppParams: prop}" @rva-button-click="handleFormButtonClick"
        ></rva-form>
      </el-dialog>
    </template>
  </el-dropdown>
  <span v-else>{{prop ? prop.name : ''}}</span>
</template>

<script>

import config from '@/api/rva/config'
export default {
  mixins: [config]
};
</script>
